package com.xiangge.domain;

public class Girlfriend {
    // 定义女朋友的属性：姓名、身高、体重  行为：洗衣服、做饭
    // 使用私人权限修饰符private，确保数据的安全
    private String name;
    private double height;
    private double weight;
    // 定义女朋友的行为
    public void show(){
        System.out.println("我女朋友叫" +name+",身高" +height+"厘米,体重"+weight+"斤");
    }
    public void cook(){
        System.out.println("女朋友给我做饭");
    }
    public void wash(){
        System.out.println("女朋友帮我洗衣服");
    }

    // 因为使用了private权限修饰符，要对每一个对象进行公开的数据拿取和设置
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }
    // 创建无参构造函数
    public Girlfriend() {
    }
    // 创建有参构造函数
    public Girlfriend(String name, double height, double weight) {
        this.name = name;
        this.height = height;
        this.weight = weight;
    }
}
